package com.wit.zhenghao.day11;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

import org.junit.Test;

public class DemoChar {

	@Test
	public void test() throws IOException {
		File file = new File("a.txt");
		file.createNewFile();
		try (FileOutputStream out = new FileOutputStream("a.txt");) {
			out.write('A');
			out.write('中');
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
	@Test
	public void test2() {
		try (FileInputStream in = new FileInputStream("a.txt");) {
			System.out.println((char)in.read());
			System.out.println((char)in.read());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
